<?php

namespace frontend\modules\commission\controllers;

use Yii;
use frontend\modules\commission\components\Controller;

/**
 * 分销订单
 *
 * @author emhome<emhome@163.com>
 * @since 2.0
 */
class QrcodeController extends Controller {

    /**
     * Renders the index view for the module
     * @return string
     */
    public function actionIndex() {
        $member = $this->member;
        $qrcode = $member->getQrcodeUrl();
        if ($qrcode) {
            return [
                'title' => '您的专属二维码',
                'message' => '长按或者点击按钮保存二维码到本地',
                'icon' => $qrcode,
                'qrcode' => $qrcode
            ];
        }
        return [
            'title' => '暂未生成专属二维码',
            'message' => '会员二维码可能会出现延迟更新，请等待您的二维码生成',
            'icon' => '/static/icons/blank_qrcode.png',
            'qrcode' => ''
        ];
    }

}
